package com.ruomeng.robot.entity;

import com.ruomeng.robot.util.MoneyUtil;

public class ExplosiveGoods{

    private String goodsId;//商品ID

    private String couponId;//优惠券ID

    private String sellerId;//店主ID

    private Integer shopType;//店铺类型 1淘宝 2天猫

    private String shopId;//店铺ID

    private Integer initVoucherCount;//初始领券量
    
    private String goodsName;//商品标题

    private Integer currentVoucherCount;//当前领券量

    private Integer voucherSumCount;//券总量

    private Integer voucherMoney;//券金额

    private Integer commissionRate;//佣金比率

    private Integer commissionType;//佣金类型(1-通用 2-定向 3-鹊桥 4-营销)

    private String commodityImg;//商品主图

    private Integer commodityType;//商品状态(0-正常 1-失效)

    private Integer commodityPrice;//商品价格

    private String entryTime;//录入时间

    private String createdTime;//创建时间
    
    
    //==================商品文案表=============start======================
    private Integer burstSectionId;//爆款表ID(来源表explosive_goods主键id)

    private Integer voucherId;//券表ID

    private Integer status;//status

    private String image;//图片地址

    private String image2;//image2

    private String content;//内容
    
    private Integer pageSize;//分页使用
    
    
    private Integer goodTimeSort;
    
    //private String voucherPrice;//1.券后价  商品价格 - 券价格
    
    //private Integer moreVoucherNum;//2.剩余券数量 总券量-当前领券量

    /**
     * 新增 商品链接case 1 天猫 https://detail.tmall.com/item.htm?id=" + goodsId
                 case 2 淘宝 https://item.taobao.com/item.htm?id=" + goodsId
     */
    //private String commodityLink;
    
    /**
     * 天猫淘宝图标路径
			case 1 天猫 ../img/tianmao.png
			case 2 淘宝 ../img/taobao.png
     */
    //private String imgLink;
    //==================商品文案表================endt=========================
    
    
    public String getGoodsId() {
        return goodsId;
    }

    public String getVoucherPrice() {
    	if((commodityPrice - voucherMoney)<=0)
    	{
    		return "0.00";
    	}
    	else
    	{
    		return MoneyUtil.toStringInt(commodityPrice - voucherMoney);
    	}
	}

	public Integer getMoreVoucherNum() {
		int voucherSum=voucherSumCount - currentVoucherCount;
		return voucherSum < 0 ? 0 : voucherSum;
	}

	public Integer getPageSize() {
		return pageSize;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	public String getGoodsName() {
		return goodsName;
	}

	public void setGoodsName(String goodsName) {
		this.goodsName = goodsName;
	}

	public Integer getBurstSectionId() {
		return burstSectionId;
	}

	public void setBurstSectionId(Integer burstSectionId) {
		this.burstSectionId = burstSectionId;
	}

	public Integer getVoucherId() {
		return voucherId;
	}

	public void setVoucherId(Integer voucherId) {
		this.voucherId = voucherId;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}

	
	public String getImage2() {
		if(image2!=null)
		{
			if(image2.indexOf("upload") != -1)
			{
				return "http://47.92.82.118"+image2;
			}
			else
			{
				return "http://img.taobao218.com/"+image2;
			}
			
		}
		return image2;
	}

	public void setImage2(String image2) {
		this.image2 = image2;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public void setGoodsId(String goodsId) {
        this.goodsId = goodsId == null ? null : goodsId.trim();
    }

    public String getCouponId() {
        return couponId;
    }

    public void setCouponId(String couponId) {
        this.couponId = couponId == null ? null : couponId.trim();
    }

    public String getSellerId() {
        return sellerId;
    }

    public void setSellerId(String sellerId) {
        this.sellerId = sellerId == null ? null : sellerId.trim();
    }

    public Integer getShopType() {
        return shopType;
    }

    public void setShopType(Integer shopType) {
        this.shopType = shopType;
    }

    public String getShopId() {
        return shopId;
    }

    public void setShopId(String shopId) {
        this.shopId = shopId == null ? null : shopId.trim();
    }

    public Integer getInitVoucherCount() {
        return initVoucherCount;
    }

    public void setInitVoucherCount(Integer initVoucherCount) {
        this.initVoucherCount = initVoucherCount;
    }

    public Integer getCurrentVoucherCount() {
        return currentVoucherCount;
    }

    public void setCurrentVoucherCount(Integer currentVoucherCount) {
        this.currentVoucherCount = currentVoucherCount;
    }

    
    public Integer getVoucherSumCount() {
    	return voucherSumCount;
    }

    public void setVoucherSumCount(Integer voucherSumCount) {
        this.voucherSumCount = voucherSumCount;
    }

    
    public String getVoucherMoney() {
        return MoneyUtil.toStringInt(voucherMoney);
    }

    public void setVoucherMoney(Integer voucherMoney) {
        this.voucherMoney = voucherMoney;
    }

   
    public String getCommissionRate() {
    	return MoneyUtil.toStringInt(commissionRate);
    }

    public void setCommissionRate(Integer commissionRate) {
        this.commissionRate = commissionRate;
    }

    public String getCommissionType() {
    	if(commissionType!=null)
    	{
    		if(commissionType==1)
    		{
    			return "通用";
    		}
    		else if(commissionType==2)
    		{
    			return "定向";
    		}
    		else if(commissionType==3)
    		{
    			return "鹊桥";
    		}
    		else if(commissionType==4)
    		{
    			return "营销";
    		}
    		else
    		{
    			 return "通用";
    		}
    	}
    	return "通用";
       
    }

    public void setCommissionType(Integer commissionType) {
        this.commissionType = commissionType;
    }

    public String getCommodityImg() {
    	if(commodityImg!=null)
    	{
    		if(commodityImg.indexOf("http://") != -1)
    		{
    			return commodityImg;
    		}
    		else
    		{
    			return "http:"+commodityImg;
    		}
    	}
        return commodityImg;
    }

    public void setCommodityImg(String commodityImg) {
        this.commodityImg = commodityImg == null ? null : commodityImg.trim();
    }

    public Integer getCommodityType() {
        return commodityType;
    }

    public void setCommodityType(Integer commodityType) {
        this.commodityType = commodityType;
    }

   
    public String getCommodityPrice() {
    	return MoneyUtil.toStringInt(commodityPrice);
    }

    public void setCommodityPrice(Integer commodityPrice) {
        this.commodityPrice = commodityPrice;
    }

	public String getEntryTime() {
		return entryTime;
	}

	public void setEntryTime(String entryTime) {
		this.entryTime = entryTime;
	}

	public String getCreatedTime() {
		return createdTime;
	}

	public void setCreatedTime(String createdTime) {
		this.createdTime = createdTime;
	}

	public Integer getGoodTimeSort() {
		return goodTimeSort;
	}

	public void setGoodTimeSort(Integer goodTimeSort) {
		this.goodTimeSort = goodTimeSort;
	}
    
	

   
}